<view class="emotion-page">
    <scroll-view scrollY style="height:90vh;">
        <view bindtap="saveImgToPhone" class="saveButton" wx:if="{{!isTextEdit}}">
            <text class="icon-save"></text>
        </view>
        <view class="imageView">
            <image disableScroll="true" mode="aspectFit" src="{{emotionUrl}}"></image>
            <text bindtap="{{item.isTextActive?'focusInput':null}}" bindtouchmove="{{item.isTextActive?'textMove':null}}" bindtouchstart="{{item.isTextActive?'textMoveStart':null}}" class="{{item.isTextActive?'active-text':'compete-text'}}" style="left:{{item.textL}}px;top:{{item.textT}}px;font-size:{{item.fontSize}}px;color:{{item.fontColor}};font-style:{{item.fontStyle}};font-weight:{{item.fontWeight}}" wx:for="{{allText}}" wx:key="idx">{{item.someText}}</text>
            <input bindinput="inputText" confirmType="done" focus="{{inputFocus}}" style="position:absolute;top:0;left:-9999px;"></input>
            <canvas canvasId="tempCanvas" disableScroll="true" style="width:400rpx; height:400rpx;position:absolute;left:-99999px;"></canvas>
            <view class="round shadow" style="padding-left:15px;padding-right:15rpx;">
                <view class=" text-sm text-left">
                    <text class="text-grey">输入文字后可自由拖动文字，点击保存图标进入预览图片</text>
                </view>
            </view>
        </view>
        <adComponent  wx:if="{{ad}}" ad="{{ad}}"/>
    </scroll-view>
    <view>
        <view class="toolbar-top toolbar-width" wx:if="{{isChooseFontSize}}">
            <view class="slider-box">
                <slider showValue bindchange="fontsizeSliderChange" max="26" min="8" value="14"></slider>
            </view>
        </view>
        <view class="toolbar-top" wx:if="{{isChooseFontColor}}">
            <view class="color-box">
                <view bindtap="fontColorChange" class="color-point" data-selected="{{item}}" style="background:{{item}}" wx:for="{{allColor}}"></view>
            </view>
        </view>
        <view class="toolbar-top toolbar-font-style" wx:if="{{isChooseFontPattern}}">
            <view>
                <text>斜体 : </text>
                <switch bindchange="fontStyleChange"></switch>
            </view>
            <view>
                <text>加粗 : </text>
                <switch bindchange="fontWeightChange"></switch>
            </view>
        </view>
        <view class="toolbar-bottom">
            <view bindtap="{{isTextEdit?null:'chooseaddText'}}">
                <text class="icon-add"></text>
                <text class="text">添加</text>
            </view>
            <view bindtap="chooseFontsize">
                <text class="icon-size"></text>
                <text class="text">大小</text>
            </view>
            <view bindtap="chooseFontColor">
                <text class="icon-color"></text>
                <text class="text">颜色</text>
            </view>
            <view bindtap="chooseFontPattern">
                <text class="icon-style"></text>
                <text class="text">样式</text>
            </view>
        </view>
    </view>
    <view class="confirm-bar1" wx:if="{{isTextEdit}}">
        <text bindtap="cancelAddText" class="icon-cross"></text>
    </view>
    <view class="confirm-bar2" wx:if="{{isTextEdit}}">
        <text bindtap="competeAddText" class="icon-checkmark"></text>
    </view>
</view>
